import { legacy_createStore, combineReducers, applyMiddleware } from "redux";
import redurcers from "./redurcers";
import thunk from "redux-thunk";
import countSaga from "./saga/count";
import createSagaMiddleware from "redux-saga";
const sagaMiddleware = createSagaMiddleware(); //创建saga中间件
const store = legacy_createStore(
  combineReducers(redurcers),
  applyMiddleware(thunk, sagaMiddleware)
);
sagaMiddleware.run(countSaga); //运行指定的saga

export default store;
